import request from '../utils/request.js'

// 获取角色列表
export const rolessApi = () => {
  return request.get('/roles')
}
// 获取角色的树状权限列表
export const rightslistApi = () => {
  return request.get('/rights/tree')
}

// 删除角色权限点
export const delRightsApi = (roleId, perId) => {
  return request.delete(`/roles/${roleId}/rights/${perId}`)
}

// 获取权限列表
export const rightsApi = () => {
  return request.get('/rights/list')
}

// 授权角色权限清单
export const addRightsApi = (roleId, rids) => {
  return request.post(`/roles/${roleId}/rights`, {
    rids
  })
}
